//
//  RHDocumentCell.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2024/4/26.
//

#import "RHDocumentCell.h"
@interface RHDocumentCell()

@end

@implementation RHDocumentCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self setupUI];
    }
    return self;
}
-(void)setupUI{
    self.contentView.backgroundColor = CFTabViewBgColor;
    UIView *bgView = kView;
    bgView.backgroundColor = [UIColor whiteColor];
    [bgView rounded:8 width:1 color:kBorderColor];
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsMake(15, 15, 0, 15));
        
    }];
    _fileNameLab = [[QMUILabel alloc]init];
    _fileNameLab.numberOfLines = 0;
    _fileNameLab.text = @"--";
    _fileNameLab.font = kBOLDSYSTEMFONT(14);
    _fileNameLab.textColor = kCOLOR_HEX(@"3F4443");
    [bgView addSubview:_fileNameLab];
 
    
    QMUILabel *typeTitleLab = [[QMUILabel alloc]init];
    typeTitleLab.text = [NSString stringWithFormat:@"%@: ",@"设备类型".rh_localized];
    typeTitleLab.font = kSYSTEMFONT(12);
    typeTitleLab.textColor = kCOLOR_HEX_A(@"#171A1D", 0.6);
    [bgView addSubview:typeTitleLab];
    
    _typeContentLab = [[QMUILabel alloc]init];
    _typeContentLab.text = @"--";
    _typeContentLab.font = kSYSTEMFONT(12);
    _typeContentLab.textColor = kCOLOR_HEX_A(@"171A1D", 0.6);
    [bgView addSubview:_typeContentLab];
    
    UIImageView *arrowImg = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"service_arrow"]];
    [bgView addSubview:arrowImg];
    
    kWeakSelf;
    [_fileNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_offset(15);
        make.right.equalTo(arrowImg.mas_left).offset(-15);
        make.top.mas_offset(20);
       
    }];
    
    [typeTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.fileNameLab);
        make.top.equalTo(weakSelf.fileNameLab.mas_bottom).offset(10);
        make.bottom.mas_offset(-15);
    }];
    
    [_typeContentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(typeTitleLab.mas_right);
        make.centerY.equalTo(typeTitleLab);
    }];
   
    [arrowImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_offset(-15);
        make.width.height.offset(20);
        make.centerY.mas_offset(0);
    }];
}

@end
